package registnet.records.summary.freq;

import java.util.HashMap;

import registnet.records.DegreeProgram;
import resources.Constants;

public class ClassificationFrequency {

	private DegreeProgram degreeProgram;
	private int semester;
	private int year;
	private HashMap<String, Integer> frequencies = new HashMap<String, Integer>();
	
	public ClassificationFrequency(DegreeProgram degreeProgram, int semester, int year){
		this.degreeProgram = degreeProgram;
		this.semester = semester;
		this.year = year;
		this.initialize();
	}

	public DegreeProgram getDegreeProgram() {
		return degreeProgram;
	}

	public void setDegreeProgram(DegreeProgram degreeProgram) {
		this.degreeProgram = degreeProgram;
	}



	public int getSemester() {
		return semester;
	}

	public void setSemester(int semester) {
		this.semester = semester;
	}

	public int getYear() {
		return year;
	}

	public void setYear(int year) {
		this.year = year;
	}
	
	public int getFrequency(String classification){
		return this.frequencies.get(classification);
	}
	
	public HashMap<String, Integer> getFrequencies(){
		return this.frequencies;
	}
	
	public void setFrequency(String classification, Integer count){
		this.frequencies.put(classification, count);
	}
	
	private void initialize(){
		for(int i=0; i<Constants.CLASSIFICATION.length; i++){
			this.frequencies.put(Constants.CLASSIFICATION[i], 0);
			System.out.println(Constants.CLASSIFICATION[i]);
		}
	}
}
